home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 1 / Amiga Tools.iso / egs-tools / egs_dev-disk / egsdemos / egsexamples / requester / file / makegadget.c < prev    next >
Encoding:
Text File  |  1994-06-06  |  1.6 KB  |  70 lines

  1. /**
  2.  **  Author: mvk
  3.  **   Date: 18. Dezember 1992
  4.  **
  5.  **  (C) by  VIONA-Development 1991,1993
  6.  **
  7.  **  Create some Gadgets
  8.  **
  9.  **/
  10.  
  11. EB_StrArray    text  = {
  12.                          "HHH & MVK Alpha-Version",
  13.                          "from 18. Dec, 92 for Testing",
  14.                          "© by VIONA Development",NULL };
  15. EB_StrArray    Gads1 = { "Record","Play","Load","Save",NULL };
  16. EB_StrArray2   Gadgs = { &Gads1,NULL };
  17.  
  18.  
  19. EI_WindowPtr CreateGads (EI_WindowPtr win)
  20. {
  21.   EB_GadBoxPtr root,help;
  22.  
  23.   con = EB_CreateGadContext(NULL,NULL,-1,-1);
  24.   if(con == NULL)
  25.           return(NULL);
  26.  
  27.   help = EB_CreateHorizBox(con);
  28.  
  29.   EB_AddLastSon(help, EB_CreateHorizFill(con,0,0));
  30.   EB_AddLastSon(help, EB_CreateMultiAction2(con, &Gadgs,0x1000 ));
  31.         EB_AddLastSon(help, EB_CreateHorizFill(con,0,0));
  32.  
  33.   root = EB_CreateVertiBox(con);
  34.  
  35.   EB_AddLastSon(root,EB_CreateMultiText(con,&text));
  36.  
  37.   EB_AddLastSon(root,help);
  38.  
  39.   if (win != NULL)
  40.   {                              /* sub -2 because for rendering */
  41.     root->MinWidth=win->Width-2;
  42.     root->MaxWidth=win->Width-2;
  43.     root->MinHeight=win->Height-2;
  44.     root->MaxHeight=win->Height-2;
  45.   }
  46.  
  47.  
  48.    if (EB_ProcessGadBoxes(con, root))
  49.     {
  50.       if (win == NULL)
  51.       {
  52.       con->NewWin->IDCMPFlags         = myEdcmpFlags;
  53.       con->NewWin->Title              = "REQUESTER DEMO";
  54.  
  55.       con->NewWin->Bordef.SysGadgets = myWinGads;
  56.       con->NewWin->MaxWidth           = 800;
  57.       con->NewWin->Flags             |= myWinFlags;
  58.       con->NewWin->MaxHeight          = 600;
  59.  
  60.       return (EI_WindowPtr)EI_OpenWindow(con->NewWin);
  61.       }
  62.       else
  63.           return win;
  64.     }
  65.   else
  66.     return NULL;
  67.  
  68. }
  69.  
  70.